{extend name="base" /}
{block name="style"}
    <script src="__STATIC__/doclist/js/ipage/ipage.js"></script>
    <script src="__STATIC__/doclist/js/user/methods.js"></script>
    <script src="__STATIC__/doclist/js/user/main.js"></script>
    <link rel="stylesheet" href="__STATIC__/doclist/css/user.css">
{/block}
{block name="body"}
    <div id="user_box" style="{if condition = '$user_info.bg_img'}background:url({$user_info.bg_img}) no-repeat{else /}background:url(/static/doclist/images/7777777.png) no-repeat;{/if}">
        <div class="user_box">
            <div class="set_bg_pic">设置背景</div>
            <form enctype="multipart/form-data" action="/index/user/setBgImage" method="post" id="ASMJHDGUYASGD">
                <input type="file" name="bg_file" class="asdasdasdas" style="display:none;">
            </form>
            <div class="user_item">
                <div class="head_pic">
                    {if condition = "$user_info.header_url neq ''"}<img src="{$user_info.header_url}" alt="">{else /}<img src="__STATIC__/doclist/images/88888.png" alt="">{/if}
                </div>
                <form enctype="multipart/form-data" action="/index/user/setHeaderImg" method="post" id="HeaderImage">
                    <input type="file" name="head_img" class="header_img_res" style="display:none;">
                </form>
                <div class="nickname">
                    <h2>{$user_info.nickname}</h2>
                    {eq name="$user_info.open_vip" value = '1'}<span class="vip">VIP</span>{/eq}
                </div>
                <div class="info">
                    <div class="item">
                        {eq name='$user_info.sex' value='0'}保密{/eq}{eq name='$user_info.sex' value='1'}<img class="icon_img" src="/static/doclist/icons/man.png" />男{/eq}{eq name='$user_info.sex' value='2'}<img class="icon_img" src="/static/doclist/icons/woman.png" />女{/eq}</div>
                    <div class="item">
                        <img class="icon_img" src="/static/doclist/icons/site.png" />{$user_info.province} {$user_info.city}</div>
                </div>
                <div class="option">
                    <div class="pic btn">上传素材</div>
                    <div class="doc btn"><a target="_blank" href="/index/user/wenan">上传文案</a></div>
                </div>
                <div class="total">
                    <div class="item">图片作品数：{$user_info.i_count}&nbsp;&nbsp;&nbsp;&nbsp;文案作品数：{$user_info.w_count}</div>
                </div>
            </div>
        </div>
    </div>
    <div id="pic_upload">
        <div class="pic_upload">
            <div class="tops">
                <div class="item" type="">
                    <span class="active" type="single">单图</span>
                    <span type="multi">多图</span>
                </div>
            </div>
            <form id="pic_form" enctype="multipart/form-data" action="/index/test/testapi" method="post">
                <div id="pic_upload_single" class="upload">
                    <div class="imglist">
                           
                    </div>
                    <div class="button">
                        <button type="button" class="upload_btn mdui-ripple">点击上传</button>
                        <br>
                        <p>*也可以拖拽到该区域，完成上传</p>
                    </div>
                    <input type="file" class="pic_upload_files"><!-- 多图上传添加multiple="true" -->
                </div>
                <div class="input select radio">
                    <span class="name">选择图片类型：</span>
                    <div class="checkbox_item">
                        <label class="active">
                            <input type="radio" name="pic_class" value="1" checked/>
                            <i></i>纯图
                        </label>
                        <!-- <label>
                            <input type="radio" name="pic_class" value="2" />
                            <i></i>带字图片
                        </label> -->
                    </div>
                </div>
                <div class="input select checkbox">
                    <span class="name">选择图片版权：</span>
                    <div class="checkbox_item">
                        {foreach name=":config('type')" key="k1" item="v1"}
                        <label {eq name="$k1" value="0"}class="active"{/eq}>
                            <input type="checkbox" {eq name="$k1" value="0"}checked{/eq} name="type" value="{$v1.value}" />
                            <i></i>{$v1.name}
                        </label>
                        {/foreach}
                    </div>
                </div>
                <div class="input select checkbox">
                    <span class="name">选择图片分类：</span>
                    <div class="checkbox_item">
                        {foreach name="category" key="k" item="v"}
                        <label {eq name="$k" value="0"}class="active"{/eq}>
                            <input type="checkbox" {eq name="$k" value="0"}checked{/eq} name="pid" value="{$v.id}" />
                            <i></i>{$v.name}
                        </label>
                        {/foreach}
                    </div>
                </div>
                <div class="input">
                    <span class="name">自定义标签：</span>
                    <div class="input_item">
                        <input type="text" class="input_tags" value="" placeholder="输入自定义标签"/>
                        <input type="hidden" name="diy_tags" class="diy_tags"/>
                        <button type="button" class="set_tags">添加</button>
                        <div class="tag_list">

                        </div>
                    </div>
                </div>
                <div class="input">
                    <span class="name">图片标题：</span>
                    <div class="input_item">
                        <input type="text" name="title" class="input_tags" value="" placeholder="输入标题"/>
                        <button type="button" class="set_title">保存</button>
                    </div>
                </div>
                <p class="tip">禁止上传色情，反动等违法素材，背景图类型：站内重复图、图片模糊、不完整、侵权（有版权的卡通动漫、影视、游戏、真实人物等）、纯图请勿带文字</p>
                <button type="button" class="form_submit submit">上传</button>
            </form>
        </div>
    </div>


    <div class="teble_btn">
        <a class="teble_item" href="#table_cont1" active>图片作品</a>
        <a class="teble_item" href="#table_cont2">文案作品</a>
        <a class="teble_item" href="#table_cont3">我的收藏</a>
        <a class="teble_item" href="#table_cont4">账号设置</a>
    </div>
    <div id="table_box">
        <div class="table_box">
            <div class="table_box_item" id="table_cont1">
            	<!-- <select style="margin:5px 0;" class="mdui-select" mdui-select="{position: 'bottom'}">
				  <option value="1">文案作品</option>
				  <option value="2">图片作品</option>
				  <option value="4">标题</option>
				  <option value="5">视频</option>
                </select> -->
                {if condition="$img_list"}
                <div class="pic_list">
                    <div class="list">
                        {foreach name="img_list" item="val"}
                        <div class="item" type="pic">
                            <div class="img">
                                <img src="{$val.thumb}" alt="">
                                <div class="tag">
                                    {foreach name=":config('type')" item="v2"} {eq name="$val.type" value="$v2.value"} {$v2.name} {/eq} {/foreach}
                                </div>
                                <div class="hover">
                                    <div class="like active ">收藏</div>
                                    <a target="_blank" href="/index/download/download/id/{$val.id}/type/image" class="download">
                                        <i class="mdui-icon material-icons">vertical_align_bottom</i>点击下载</a>
                                </div>
                            </div>
                            <p>{$val.title}</p>
                        </div>
                        {/foreach}
                    </div>
                </div>
                <div class="toppages global_pages">
                    {$img_list->render();}
                </div>
                {else /}
                <div class="not_found">
                    你还没有相关作品，点击
                    <a href="#">点击这里</a>上传素材
                </div>
                {/if}
            </div>
            <div class="table_box_item" id="table_cont2">
            	<!-- <select style="margin:5px 0;" class="mdui-select" mdui-select="{position: 'bottom'}">
				  <option value="1">文案作品</option>
				  <option value="2">图片作品</option>
				  <option value="4">标题</option>
				  <option value="5">视频</option>
                </select> -->
                {if condition="$wenan_list"}
                <div class="pic_list">
                    <div class="list">
                        {foreach name="wenan_list" item="wenan"}
                        <div class="item" type="doc">
                            <a target="_blank" href="/index/download/download/id/{$wenan.id}/type/wenan/sid/{$wenan.wid}">
                                <div class="img">
                                    <img src="{$wenan.thumb}" alt="">
                                    <div class="title">{$wenan.title}</div>
                                </div>
                                {if condition="$wenan.abstract"}
                                <p class="zy">{$wenan.abstract}</p>
                                {/if}
                                <div class="time">{$wenan.create_time}</div>
                            </a>
                        </div>
                        {/foreach}
                    </div>
                </div>
                <div class="toppages global_pages">
                    {$img_list->render();}
                </div>
                {else /}
                <div class="not_found">
                    你还没有相关作品，点击
                    <a href="#">点击这里</a>上传素材
                </div>
                {/if}
            </div>
            <div class="table_box_item" id="table_cont3">
            	<select style="margin:5px 0;" class="mdui-select" mdui-select="{position: 'bottom'}">
				  <option value="1">文案作品</option>
				  <option value="2">图片作品</option>
				  <option value="4">标题</option>
				  <option value="5">视频</option>
                </select>
                <div id="collection">
                {if condition="$img_list eq ''"}
                    <div class="not_found">
                        你还没有收藏作品哦！赶快去浏览作品吧
                    </div>
                {/if}
                </div>
            </div>
            <div class="table_box_item" id="table_cont4">
                <div class="user_info">
                    <form id="edit_user_info" action="/index/user/update" method="post">
                        <div class="input">
                            <span class="name">昵称：</span>
                            <input type="text" name="nickname" value="{$user_info.nickname}" />
                        </div>
                        <div class="input">
                            <span class="name">手机号：</span>
                            <input type="text" name="mobile" value="{$user_info.mobile}" placeholder="未填写" />
                        </div>
                        <div class="input">
                            <span class="name">QQ号：</span>
                            <input type="text" name="qq" value="{$user_info.qq}" placeholder="未填写" />
                        </div>
                        <div class="input">
                            <span class="name">城市：</span>
                            <input type="text" name="city" value="{$user_info.city}" placeholder="未填写" />
                        </div>
                        <div class="input radio">
                            <span class="name">性别：</span>
                            <label {eq name="$user_info.sex" value="1"}class="active"{/eq}>
                                <input type="radio" name="sex" value="1" {eq name="$user_info.sex" value="1"}checked{/eq}>男
                            </label>
                            <label {eq name="$user_info.sex" value="2"}class="active"{/eq}>
                                <input type="radio" name="sex" value="2" {eq name="$user_info.sex" value="2"}checked{/eq}>女
                            </label>
                        </div>
                        <button type="button" class="form_submit submit">保存设置</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
{/block}
{block name='script'}
<script>
    $(document).ready(function(){
        $('.mdui-select').on('change',function(){
            var val = $(this).val();
            collection(val);
        });

        collection(1);
    });

    function collection(val){
        $.ajax({
            url:"/index/user/collectionList/val/"+val,
            success:function(res){
                $('#collection *').remove();
                if(res == false){
                    $('#collection').append('<div class="not_found">你还没有收藏作品哦！赶快去浏览作品吧</div>');
                }else{
                    $('#collection').append(res);
                }
            }
        })
    }
</script>
{/block}
